/**
 * 此脚本演示实现了Copy特质的struct在转赋情况下的表现-- 只是复制，不夺取所有权
 */
#[derive(Debug,Copy,Clone)]
enum EggCategory{
    土鸡,
    散养鸡,
    家养鸡,
    饲料鸡,
    野鸡
}

#[derive(Copy,Clone,Debug)]
struct Egg{
    weight:u8,
    category:EggCategory
}
#[derive(Debug)]
struct Pig{
    name:String,
    weight:u16
}

fn main() {
    let  egg1 = Egg{weight: 10, category:EggCategory::土鸡};
    let  egg2 = egg1;
    println!("{:?}",egg1);
    println!("{:?}",egg2);

    let pig = Pig{name:String::from("猪"),weight: 100};
    //let _pig2 = pig;  这个会报错提示:consider implementing `Clone` for this type
    println!("{:?}",pig);
}